//
//  LogionImplementations.swift
//  MikerShop
//
//  Created by eme on 2016/11/9.
//  Copyright © 2016年 eme. All rights reserved.
//

import Foundation
import RxSwift

class LoginValidationService: LoginValidationProtocol {

    
    func validateUsername( _ username:String)  -> ValidationResult{
        if username.characters.count == 0 {
            return .empty
        }
        if username.characters.count >= 6{
            return .ok(message: "验证正确")
        }else{
            return .failed(message: "用户名不能少于6个字符")
        }
    }
    func validatePassword( _ password:String)  -> ValidationResult{
        if password.characters.count == 0 {
            return .empty
        }
        if password.characters.count >= 6{
            return .ok(message: "验证正确")
        }else{
            return .failed(message: "密码不能少于6个字符")
        }
    }
}
